home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / FrexxEd / fpl / FileFilter.FPL.README < prev    next >
Encoding:
Text File  |  1996-09-27  |  2.2 KB  |  83 lines

  1. ############################################
  2. File:        FileFilter.FPL
  3. Author:        Daniel Stenberg
  4. Email:        dast@sth.frontec.se, FidoNet 2:201/328
  5. Short:        Load/Save a file through a "filter"
  6. Version:    1.2
  7. Date:        20.1.95
  8. Local settings:
  9. Global settings:
  10. Keysequence:
  11. Type:        function
  12. Prereq:
  13. ############################################
  14.  
  15. HISTORY
  16.     1.1 -    Added the SaveFilter() function.
  17.     1.2 -    Replaced all Sprintf() with sprintf().
  18.  
  19. NAME    LoadFilter - Load a file through a "filter"
  20.  
  21. SYNOPSIS
  22.     Failure LoadFilter ( fullfile, filter, options );
  23.  
  24.     int LoadFilter ( string, string, string );
  25.  
  26. FUNCTION
  27.     The specified file is first run through the 'filter' program and then
  28.     loaded into FrexxEd. The filter program must accept the raw file as
  29.     stdin and produce output on stdout.
  30.  
  31. INPUTS
  32.     fullfile -    File name to load through the filter.
  33.  
  34.     filter -    Full path name to the filter executable.
  35.  
  36.     options -    Command line options to send to the filter program.
  37.  
  38. RESULT
  39.     0 if everything is OK, otherwise non-zero.
  40.  
  41. EXAMPLE
  42.     This function was kind of made for the frexxwrap filter, but I decided
  43.     to make this a general filter loading function. To use the frexxwrap
  44.     word wrapping filter on a file called dh0:mail/to_my_lov, issue the
  45.     following function instead of a straight Load():
  46.  
  47.         LoadFilter("dh0:mail/to_my_lov",
  48.                "FrexxEd:bin/fwrap",
  49.                "-s \"\" -c 79");
  50.  
  51. NAME    SaveFilter - Save a file through a "filter"
  52.  
  53. SYNOPSIS
  54.     Failure SaveFilter ( fullfile, filter, options );
  55.  
  56.     int SaveFilter ( string, string, string );
  57.  
  58. FUNCTION
  59.     The current buffer is run through the 'filter' program and stored with
  60.     the 'fullfile' name when saved.
  61.     The filter program must accept the raw file as stdin and produce
  62.     output on stdout.
  63.  
  64. INPUTS
  65.     fullfile -    File name to load through the filter.
  66.  
  67.     filter -    Full path name to the filter executable.
  68.  
  69.     options -    Command line options to send to the filter program.
  70.  
  71. RESULT
  72.     0 if everything is OK, otherwise non-zero.
  73.  
  74. EXAMPLE
  75.     To encrypt the file "to_my_lov" you're saving, using the enryption
  76.     program called 'cipher' (usage 'cipher -k <key>'), run the following:
  77.  
  78.         string key = GetString("enter password");
  79.         SaveFilter("dh0:mail/to_my_lov",
  80.                "cipher",
  81.                joinstr("-k ", key));
  82.  
  83.